<template>
    <div class="common-layout">
      <el-container>
        <el-aside>
          <el-row class="tac">
    <el-col>
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="0"
        text-color="#fff" 
      >
        <el-sub-menu v-for="item in routes" :key="item.path" :index="item.path" :router="true">
          <template #title>
            <el-icon><location /></el-icon>
            <span>{{ item.meta?.title }}</span>
          </template>
        </el-sub-menu>
        <!-- <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>Navigator Two</span>
        </el-menu-item>
        <el-menu-item index="3" disabled>
          <el-icon><document /></el-icon>
          <span>Navigator Three</span>
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon><setting /></el-icon>
          <span>Navigator Four</span>
        </el-menu-item> -->
      </el-menu>
    </el-col>
  </el-row>
        </el-aside>
        <el-container>
          <el-header>Header</el-header>
          <el-main><RouterView/></el-main>
        </el-container>
      </el-container>
    </div>
  </template>
<script setup lang="ts">
import { useRoute } from 'vue-router'

// import {
//   Document,
//   Menu as IconMenu,
//   Location,
//   Setting,
// } from '@element-plus/icons-vue'
let route=useRoute();
let routes=route.matched[0].children
console.log(routes);
</script>

<style lang="scss">
.el-aside{
  width: 150px;
  height: 100vh;
}
.el-row{
  width: 150px;
}
</style>
